package org.example.guide.controller;

import org.example.guide.domain.Guide;
import org.example.guide.service.guideService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/")

public class guideController {
    @Autowired
    guideService guideservice;
    @GetMapping("/guide")
    public List<Guide> showguide(){
        return guideservice.showguide();
    }

    @GetMapping ("/searchguide")
    public List<Guide> searchguide(String keyword){
        return guideservice.searchguide(keyword);
    }

    @GetMapping ("/deleteguide")
    public void deleteguide(int id){
        guideservice.deleteguide(id);
    }

    @PostMapping("/insertguide")
    public void insertguide(@RequestBody Guide guide){
        guideservice.insertguide(guide);
    }

    @PostMapping ("/updateguide")
    public void updateguide(@RequestBody Guide guide){
        guideservice.updateguide(guide);
    }
    @PostMapping("/updateScore")
    public void updateScore(@RequestBody Guide guide){
        guideservice.updateScore(guide);
    }
}
